package com.slz3.business.module.socialManagement.socDianzan.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.socialManagement.socDianzan.domain.SocDianzan;
import com.slz3.business.module.socialManagement.socDianzan.domain.SocDianzanCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SocDianzanResAtomic {

    static Mono<ServerResponse> add_$SocDianzanUpdateLock(ServerRequest req, SocDianzan socDianzan) {
        return SocDianzanResSafeValid.add(req, socDianzan) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.add(req, socDianzan);
    }

    public static Mono<ServerResponse> delete_$SocDianzanUpdateLock(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        return SocDianzanResSafeValid.delete(req, socDianzanCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$SocDianzanUpdateLock(ServerRequest req, SocDianzan socDianzan) {
        return SocDianzanResSafeValid.modify(req, socDianzan) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.modify(req, socDianzan);
    }

    static Mono<ServerResponse> info_$SocDianzanUpdateLock(ServerRequest req) {
        return SocDianzanResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$SocDianzanUpdateLock(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        return SocDianzanResSafeValid.auditSubmit(req, socDianzanCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$SocDianzanUpdateLock(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        return SocDianzanResSafeValid.audit(req, socDianzanCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$SocDianzanUpdateLock(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        return SocDianzanResSafeValid.auditReject(req, socDianzanCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$SocDianzanUpdateLock(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        return SocDianzanResSafeValid.usingEnable(req, socDianzanCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$SocDianzanUpdateLock(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        return SocDianzanResSafeValid.usingDisable(req, socDianzanCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocDianzanResExecutor.usingDisable(req);
    }
}
